package com.smart.sso.server.service.impl;

import java.util.Collection;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.smart.mvc.model.Pagination;
import com.smart.mvc.service.mybatis.impl.ServiceImpl;
import com.smart.sso.server.dao.NodeDBDao;
import com.smart.sso.server.model.NodeDB;
import com.smart.sso.server.service.NodeDBService;

import io.mykit.db.sync.build.DBSyncExecutor;

@Service("nodeDBService")
public class NodeDBServiceImpl extends ServiceImpl<NodeDBDao, NodeDB, Integer> implements NodeDBService {

	@Override
	public Pagination<NodeDB> findPaginationByName(String name, Pagination<NodeDB> p) {
		// TODO Auto-generated method stub
		dao.findPaginationByName(name, p);
		return p;
	}
	
	@Override
	public List<NodeDB> findByDBname(String dbName){
		return dao.findByDBname(dbName);
	}

	@Autowired
	public void setDao(NodeDBDao dao) {
		// TODO Auto-generated method stub
		this.dao = dao;
	}

	@Override
	public void synchronizeDB() throws Exception {
		// TODO Auto-generated method stub
		new DBSyncExecutor().dbSyncExecut();
	}

}
